import java.util.Arrays;

public class Test {
    public static void main(String[] args) {
        int p[] = {0,1};
        int q[] = {0,1};
        int A[] = new int[4];
        int B[] = new int[4];
        int C[] = new int[4];
        int size1 = 0;
        int size3 = 0;
        for (int i = 0; i < 2; i++) {
            for(int j = 0; j < 2; j++) {
                if (p[i] == 1 && q[j] == 0) {
                    A[size1] = 0;
                    size1++;
                }
                else{
                    A[size1] = 1;
                size1++;
                }
            }
        }
        System.out.println(Arrays.toString(A));
        int size2 = 0;
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 2; j++) {
                if (p[i] != 1 || q[j] == 1) {
                    B[size2] = 1;
                    size2++;
                }
                else {
                    B[size2] = 0;
                    size2++;
                }
            }
        }
        System.out.println(Arrays.toString(B));
        for (int i = 0; i < 4; i++) {
            if(A[i]==B[i]){
                C[size3]=1;
                size3++;
            }
            else{
                C[size3]=0;
                size3++;
            }

        }
        System.out.println(Arrays.toString(C));
    }
}
